{{#with course}}
<form action="/admin/open-courses" method="post"
      enctype="multipart/form-data"
      style="width: 50%;margin: 10px;">
    <legend>新增公开课</legend>
    <!--使用隐藏域持有id-->
    <input type="hidden" name="id" value="{{id}}">

    <div class="form-group">
        <label for="name">课程名称</label>
        <input type="text" class="form-control"
               name="name" id="name" value="{{name}}">
    </div>

    <div class="form-group">
        <label for="description">课程描述</label>
        <textarea type="text" class="form-control"
                  name="description" id="description">
            {{description}}
        </textarea>
    </div>

    <div class="form-group">
        <label for="time">截止时间</label>
        <input type="datetime-local" class="form-control"
               name="time" id="time" value="{{time}}">
    </div>

    <div class="form-group">
        <label for="poster">封面图</label>
        <!--为什么要把图片地址存在隐藏域-->
        <input type="hidden" value="{{poster}}" name="poster">
        <input type="file" class="form-control" name="file" id="file">
    </div>

    <button type="submit" class="btn btn-primary">提交</button>
</form>
{{/with}}